package servlet;

import http.HttpRequest;
import http.HttpResponse;

/**
 * @Author: admin
 * @Description:
 * @Date: 2019/3/19 11:08
 */

public interface IServlet {
    void doGet(HttpRequest request, HttpResponse response);

    void doPost(HttpRequest request, HttpResponse response);

    default void service(HttpRequest request, HttpResponse response) {
        if ("POST".equalsIgnoreCase(request.getMethod())) doPost(request, response);
        else if ("GET".equalsIgnoreCase(request.getMethod())) doGet(request, response);
    }

}
